﻿Public Class BESeguranca

  ' Permissões de Segurança quando selecionada uma única Tela e um único Grupo
  Private _booLeitura As Boolean
  Private _booEscrita As Boolean
  Private _booModificacao As Boolean
  Private _booExclusao As Boolean
  Private _objBEGrupoAcesso As extranet.BE.BEGrupoAcesso
  Private _objBETela As extranet.BE.BETela

  Sub New()
    _booLeitura = False
    _booEscrita = False
    _booModificacao = False
    _booExclusao = False
    _objBEGrupoAcesso = Nothing
    _objBETela = Nothing
  End Sub

  Sub New(ByVal booLeitura As Boolean, ByVal booEscrita As Boolean, ByVal booModificacao As Boolean, ByVal booExclusao As Boolean, ByVal objBEGrupoAcesso As extranet.BE.BEGrupoAcesso, ByVal objBETela As extranet.BE.BETela)
    _booLeitura = booLeitura
    _booEscrita = booEscrita
    _booModificacao = booModificacao
    _booExclusao = booExclusao
    _objBEGrupoAcesso = objBEGrupoAcesso
    _objBETela = objBETela
  End Sub

  Sub New(ByVal objBEGrupoAcesso As extranet.BE.BEGrupoAcesso, ByVal objBETela As extranet.BE.BETela)
    Me.New()
    _objBEGrupoAcesso = objBEGrupoAcesso
    _objBETela = objBETela
  End Sub

  Public Property Leitura() As Boolean
    Get
      Return _booLeitura
    End Get
    Set(ByVal value As Boolean)
      _booLeitura = value
    End Set
  End Property

  Public Property Escrita() As Boolean
    Get
      Return _booEscrita
    End Get
    Set(ByVal value As Boolean)
      _booEscrita = value
    End Set
  End Property

  Public Property Modificacao() As Boolean
    Get
      Return _booModificacao
    End Get
    Set(ByVal value As Boolean)
      _booModificacao = value
    End Set
  End Property

  Public Property Exclusao() As Boolean
    Get
      Return _booExclusao
    End Get
    Set(ByVal value As Boolean)
      _booExclusao = value
    End Set
  End Property

  Public Property GrupoAcesso() As extranet.BE.BEGrupoAcesso
    Get
      Return _objBEGrupoAcesso
    End Get
    Set(ByVal value As extranet.BE.BEGrupoAcesso)
      _objBEGrupoAcesso = value
    End Set
  End Property

  Public Property Tela() As extranet.BE.BETela
    Get
      Return _objBETela
    End Get
    Set(ByVal value As extranet.BE.BETela)
      _objBETela = value
    End Set
  End Property

  Public Property Autorizado() As Boolean
    Get
      Return _booEscrita OrElse _booExclusao OrElse _booLeitura OrElse _booModificacao
    End Get
    Set(ByVal value As Boolean)
    End Set
  End Property

End Class
